package org.xxpay.core.entity;

import java.io.Serializable;
import java.util.Date;

public class PayDivisionRecord implements Serializable {
    /**
     * ID
     *
     * @mbggenerated
     */
    private Long id;

    /**
     * 代理商或商户ID, 平台记录为0
     *
     * @mbggenerated
     */
    private Long infoId;

    /**
     * 用户类型:1-代理商,2-商户,3-平台
     *
     * @mbggenerated
     */
    private Byte infoType;

    /**
     * 渠道接口类型代码
     *
     * @mbggenerated
     */
    private String ifTypeCode;

    /**
     * 上游渠道商户ID
     *
     * @mbggenerated
     */
    private String channelMchId;

    /**
     * 上游分账订单号
     *
     * @mbggenerated
     */
    private String channelOrderId;

    /**
     * 原始支付订单号
     *
     * @mbggenerated
     */
    private String payOrderId;

    /**
     * 分账金额,单位分
     *
     * @mbggenerated
     */
    private Long divisionAmount;

    /**
     * 分账状态,0-未分账,1-分账中,2-分账成功,3-分账失败
     *
     * @mbggenerated
     */
    private Byte status;

    /**
     * 上游分账失败原因
     *
     * @mbggenerated
     */
    private String channelErrorMsg;

    /**
     * 最后一次通知时间
     *
     * @mbggenerated
     */
    private Date lastNotifyTime;

    /**
     * 创建时间
     *
     * @mbggenerated
     */
    private Date createTime;

    /**
     * 更新时间
     *
     * @mbggenerated
     */
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getInfoId() {
        return infoId;
    }

    public void setInfoId(Long infoId) {
        this.infoId = infoId;
    }

    public Byte getInfoType() {
        return infoType;
    }

    public void setInfoType(Byte infoType) {
        this.infoType = infoType;
    }

    public String getIfTypeCode() {
        return ifTypeCode;
    }

    public void setIfTypeCode(String ifTypeCode) {
        this.ifTypeCode = ifTypeCode;
    }

    public String getChannelMchId() {
        return channelMchId;
    }

    public void setChannelMchId(String channelMchId) {
        this.channelMchId = channelMchId;
    }

    public String getChannelOrderId() {
        return channelOrderId;
    }

    public void setChannelOrderId(String channelOrderId) {
        this.channelOrderId = channelOrderId;
    }

    public String getPayOrderId() {
        return payOrderId;
    }

    public void setPayOrderId(String payOrderId) {
        this.payOrderId = payOrderId;
    }

    public Long getDivisionAmount() {
        return divisionAmount;
    }

    public void setDivisionAmount(Long divisionAmount) {
        this.divisionAmount = divisionAmount;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public String getChannelErrorMsg() {
        return channelErrorMsg;
    }

    public void setChannelErrorMsg(String channelErrorMsg) {
        this.channelErrorMsg = channelErrorMsg;
    }

    public Date getLastNotifyTime() {
        return lastNotifyTime;
    }

    public void setLastNotifyTime(Date lastNotifyTime) {
        this.lastNotifyTime = lastNotifyTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", infoId=").append(infoId);
        sb.append(", infoType=").append(infoType);
        sb.append(", ifTypeCode=").append(ifTypeCode);
        sb.append(", channelMchId=").append(channelMchId);
        sb.append(", channelOrderId=").append(channelOrderId);
        sb.append(", payOrderId=").append(payOrderId);
        sb.append(", divisionAmount=").append(divisionAmount);
        sb.append(", status=").append(status);
        sb.append(", channelErrorMsg=").append(channelErrorMsg);
        sb.append(", lastNotifyTime=").append(lastNotifyTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PayDivisionRecord other = (PayDivisionRecord) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getInfoId() == null ? other.getInfoId() == null : this.getInfoId().equals(other.getInfoId()))
            && (this.getInfoType() == null ? other.getInfoType() == null : this.getInfoType().equals(other.getInfoType()))
            && (this.getIfTypeCode() == null ? other.getIfTypeCode() == null : this.getIfTypeCode().equals(other.getIfTypeCode()))
            && (this.getChannelMchId() == null ? other.getChannelMchId() == null : this.getChannelMchId().equals(other.getChannelMchId()))
            && (this.getChannelOrderId() == null ? other.getChannelOrderId() == null : this.getChannelOrderId().equals(other.getChannelOrderId()))
            && (this.getPayOrderId() == null ? other.getPayOrderId() == null : this.getPayOrderId().equals(other.getPayOrderId()))
            && (this.getDivisionAmount() == null ? other.getDivisionAmount() == null : this.getDivisionAmount().equals(other.getDivisionAmount()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getChannelErrorMsg() == null ? other.getChannelErrorMsg() == null : this.getChannelErrorMsg().equals(other.getChannelErrorMsg()))
            && (this.getLastNotifyTime() == null ? other.getLastNotifyTime() == null : this.getLastNotifyTime().equals(other.getLastNotifyTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getInfoId() == null) ? 0 : getInfoId().hashCode());
        result = prime * result + ((getInfoType() == null) ? 0 : getInfoType().hashCode());
        result = prime * result + ((getIfTypeCode() == null) ? 0 : getIfTypeCode().hashCode());
        result = prime * result + ((getChannelMchId() == null) ? 0 : getChannelMchId().hashCode());
        result = prime * result + ((getChannelOrderId() == null) ? 0 : getChannelOrderId().hashCode());
        result = prime * result + ((getPayOrderId() == null) ? 0 : getPayOrderId().hashCode());
        result = prime * result + ((getDivisionAmount() == null) ? 0 : getDivisionAmount().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getChannelErrorMsg() == null) ? 0 : getChannelErrorMsg().hashCode());
        result = prime * result + ((getLastNotifyTime() == null) ? 0 : getLastNotifyTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }
}